import { request, USE_MOCK } from './request'

export interface ShopApp {
  id: number
  shopId: number
  userId: number
  shopName: string
  detailAddress: string
  shopPhone: string
  supportDelivery: 'true' | 'false' /* 字符串布尔 */
  deliveryFee: number
  shopImage: string
  licenseImage: string
  applyStatus: string
  auditOpinion: string /* 审核意见 */
  latitude: number
  longitude: number
  pointExchangeRate: number
}


export interface ListRsp {
  data: ShopApp[]
}

export function getShopApplicationList() {
  return request<ListRsp>({
    url: '/system/shop-application/list',
    method: 'GET',
    params: undefined
  })
}
/** 查询单个商家入驻详情 */
export function getShopApplicationDetails(shopId: number | string) {
  return request<ShopApp>({
    url: `/system/shop-application/details/${shopId}`,
    method: 'GET',
    params: undefined
  })
}
/** 修改审核状态 */
export function modifyStatus(data: {
  shopId: number
  status: string
  opinion?: string
}) {
  return request<{ code: number; message?: string }>({
    url: '/system/shop-application/audit',
    method: 'POST',
    data
  })
}
